package com.axend.aerosense.common.util;

import android.text.TextUtils;

public class StringLengthUtils {

    public static String getSimpleString(String dest, int maxLength, String suffix){
        if (TextUtils.isEmpty(dest)) return dest;
        if(dest.length() > maxLength){
            String sub = dest.substring(0, maxLength) + suffix;
            return sub;
        }else {
            return dest;
        }
    }

    public static String getSimpleString(String dest, int maxLength){
        if (TextUtils.isEmpty(dest)) return dest;
        if(dest.length() > maxLength){
            String sub = dest.substring(0, maxLength) + "...";
            return sub;
        }else {
            return dest;
        }
    }

}
